<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Receipt</title>
<style type="text/css">
	body ,table td{
		font-family: calibri;
		/*font-family: tahoma;*/
		line-height: 14px;
		font-size: 12px;
	}
	.bgcolor{   
		background : url('<?php echo JURI::base(true) ?>/components/com_ownservice/assets/images/borderbg.png') ; 
		margin:5px 0 0 0;
		padding: 5px 0 0 0;  
		border: 1px solid #EEEEEE;
	}
	.skey{
		font-weight: bold;
	}
	div#adv p{
		margin: 0;padding: 0;
	}
	span.footerprint {
		font-size: 9px;
		line-height: 10px;
	}
	.numprintright {
		float: right;
		padding: 0 20px 0 0;
		position: relative;
	}
	span.headerprint {
		font-size: 10px; 
		line-height: 10px;
	} 
</style>
</head>
<body>
<?php
//No direct access
defined('_JEXEC') or die('Restricted access');
jimport( 'joomla.utilities.date' );
$priceformat	= OwnserviceHelper::getParams('price_format', '#,###.##');
$dateformat	= OwnserviceHelper::getParams('date_format', '%d/%m/%Y');
$timeformat	= OwnserviceHelper::getParams('time_format', '%H:%i:%s');
$row				= $this->row;
$instance		= & JFactory::getDate($row->created);
$myDate		= JFactory::getDate($dateAndTime, $offset);
?>
<div id="ownservices">
	
<table width="100%" cellpadding="0" cellspacing="0">
		<tr>
			<td valign="top" style="padding-right:5px;">
		    <table width="100%" cellpadding="0" cellspacing="0" border="0">
					<tr> 
						<td align="center" valign="bottom" nowrap="nowrap" style="width:180px;">
							<div style="text-align:center;">
								<img src="<?php echo JURI::base(true) ?>/components/com_ownservice/assets/images/logo.jpg" width="108" height="91" />
							</div>
							<div align="bottom">
								<span><strong>OWN Money Services</strong></span>
							<br />
								www.ownservices.com</div>
						</td>
						<td valign="top">
			  <table width="100%" cellpadding="0" cellspacing="0">
								<tr>
									<td><span class="skey">Invoice Number:</span></td>
									<td><span style="font-size: 20px; font-weight: bold;"><?php echo $row->invoice; ?></span></td>
								</tr>
								<tr>
									<td><span class="skey">Date: <?php echo JHTML::_('date', $row->created, '%d/%m/%y'); ?></span></td>
									<td><?php /*<span 
		class="skey">Time: <?php echo /*JHTML::_('date', $dateAndTime, '%H:%M', 10);*/ /*date('H:i'); ?></span> */ ?>
									</td>
								</tr>
							</table>
							<div class="bgcolor">
								<table width="100%" cellpadding="0" cellspacing="7">
									<tr>
										<td width="100px"><span class="skey">Branch:</span></td>
										<td><span class="skey"><?php echo $row->branchname; ?></span></td>
									</tr>
									<tr>
										<td><span class="skey">Address:</span></td>
										<td><span class="skey"><?php echo $row->b_address.' '.$row->b_city.' '.$row->b_state.' '.$row->b_country.' '.$row->b_postcode; ?></span></td>
									</tr>
									<tr>
										<td><span class="skey">Phone No.:</span></td>
										<td><span class="skey"><?php echo $row->b_phone; ?></span></td>
									</tr>
									<tr>
										<td><span class="skey">E-mail:</span></td>
										<td><span class="skey"><?php echo $row->b_email; ?></span></td>
									</tr>
								</table>
							</div>
						</td>
					</tr>
				</table>
				<table width="100%" cellpadding="0" cellspacing="0">
					<tr>
						<td width="50%">
							<table width="100%" cellpadding="0" cellspacing="1">
								<tr>
									<td colspan="2"><strong>Sender Details</strong></td>
								</tr>
								<tr>
									<td><span class="skey">Name:</span> <?php echo $row->name; ?> (<?php echo $row->username; ?>)</td>
									
								</tr>
								<tr>
									<td colspan="2"><span class="skey">ID Type:</span> <?php echo ucwords($row->id_type); ?><div class="numprintright"><span class="skey">ID No.:</span> <?php echo 'xx'.substr($row->id_number,2); ?></div></td>
									
								</tr>
								<tr>
									<td colspan="2"><span class="skey">Expiry Date:</span> <?php echo JHTML::_('date', $row->expire_date, '%d/%m/%Y'); ?></td>
								</tr>
								<tr>
									<td colspan="2"><span class="skey">Issued by:</span> <?php echo $row->issuer; ?></td>
								</tr>
								<tr>
									<td colspan="2"><span class="skey">Address:</span> <?php echo $row->p_address.' '.$row->p_city.' '.$row->p_state.' '.$row->p_postcode.' '.$row->p_country; ?></td>
								</tr>
								<tr>
									<td colspan="2"><span class="skey">Phone No:</span> <?php echo $row->p_phone_no; ?></td>
								</tr>
							</table>
						</td>
						<td valign="top">
							<table width="100%" cellpadding="0" cellspacing="10">
								<tr>
									<td colspan="2"><strong>Transfer Details</strong></td>
								</tr>
								<tr>
									<td><span class="skey">Amount Transfer</span></td>
									<td align="right">(AUD) <?php echo OwnserviceHelper::moneyFormat($priceformat,$row->amount); ?></td>
								</tr>
								<tr>
									<td><span class="skey">Exchange Rate</span></td>
									<td align="right">(<?php echo $row->rate_code; ?>) <?php echo OwnserviceHelper::moneyFormat($priceformat,($row->rate+$row->extrarate)); ?></td>
								</tr>
								<tr>
									<td><span class="skey">Transfer Fee</span></td>
									<td align="right">(AUD) <?php echo OwnserviceHelper::moneyFormat($priceformat,($row->fee+$row->extrafee)); ?></td>
								</tr>
								<tr>
									<td><span class="skey">Overseas Bank Fee</span></td>
									<td align="right">(<?php echo $row->rate_code; ?>) <?php echo OwnserviceHelper::moneyFormat($priceformat,($row->bankfee+$row->extrabfee)); ?>
									</td>
								</tr>
							</table>
						</td>
					</tr>
					<tr valign="top">
						<td style="padding:5px 5px 0 0;">
							<table width="100%" cellpadding="0" cellspacing="1">
								<tr>
									<td colspan="2"><strong>Beneficiary and Bank Details</strong></td>
								</tr>
								<tr>
									<td colspan="2"><span class="skey">Name:</span> <?php echo $row->account_name; ?></td>
								</tr>
								<tr>
									<td width="60%"><span class="skey">Account No.:</span> <?php echo $row->account; ?></td>
									<td width="40%"><span class="skey">Type:</span> <?php echo ucwords($row->account_type); ?></td>
								</tr>
								<tr>
									<td>
									<span class="skey">Bank:</span> 
									<?php if($row->bank_name=='other'): ?>
										<?php echo $row->bank_other; ?>
									<?php else: ?>
										<?php echo $row->bank_name; ?>
									<?php endif; ?>
									<br />
									<span class="skey">Bank City:</span> <?php echo $row->branch_city; ?></td>
								</tr>
								<tr>
									<td colspan="2"><span class="skey">Beneficiary's Address:</span> <?php echo $row->a_address.' '.$row->a_city.' '.$row->a_state.' '.$row->a_country.' '.$row->a_postcode; ?></td>
								</tr>
								<tr>
									<td colspan="2"><span class="skey">Phone No.:</span> <?php echo $row->a_phone_no; ?></td>
								</tr>
							</table>
						</td>
						<td valign="middle">
							<div style="border: 1px solid; padding: 5px 5px;">
								<table width="100%" cellpadding="0" cellspacing="10" border="0">
									<tr>
										<td><span class="skey">Total Receivable</span></td>
										<td align="right"><span class="skey">
											(<?php echo $row->rate_code; ?>) 
											<?php 
											/*$total = 0;
											if($row->extratotal > 0.00) {
												$total = $row->extratotal;
											} else {
												$total = $row->amount * ($row->rate+$row->extrarate);
											}*/
											if($row->extratotal > 0.00) {
												echo OwnserviceHelper::moneyFormat($priceformat, $row->extratotal);
											} else {
												echo OwnserviceHelper::moneyFormat($priceformat,( ($row->amount * ($row->rate+$row->extrarate)) - ($row->bankfee+$row->extrabfee)));
											}
											?></span>
										</td>
									</tr>
									<tr>
										<td><span class="skey">Total Payment</span></td>
										<td align="right">
											<span class="skey">(AUD)
											<?php 
											echo OwnserviceHelper::moneyFormat($priceformat,($row->amount + ($row->fee+$row->extrafee)));
											?>
											</span>
										</td>
									</tr>
								</table>
							</div>
						</td>
					</tr>
					<tr>
						<td>
						<p>
						<span class="skey">Purpose of Transfer: </span>
						<?php 
							if($row->reason != 'other') {
								echo OwnserviceHelper::getReason($row->reason); 
							} else {
								echo $row->reason_other;
							}
						?>
						</p>
						</td>
						<td><p>Officer ID No.: <?php echo $row->cusername; ?></p></td>
					</tr>
					<tr>
						<td  align="center" colspan="2">
							<span class="footerprint"> Thank you for transferring money with OWN MONEY SERVICES</span>
							<br /><span class="headerprint"><strong>YOUR OWN FAST WAY TO TRANSFER MONEY</strong></span>
						</td>
					</tr>
				</table>
			</td>
			<td valign="top" style="width: 150px; border-left: 1px dotted;">
				<div id="adv">
					<?php echo $row->advertising; ?>
				</div>
			</td>
		</tr>
		<tr>
			<td>
				<table width="100%" cellpadding="10" cellspacing="10">
					<tr>
						<td>---------</td>
						<td align="center">---------</td>
						<td align="right">---------</td>
					</tr>
				</table>
			</td>
			<td style="width: 150px;" align="right">
			---------
			</td>
		</tr>
		<tr>
			<td valign="top" colspan="2">
				<table width="100%" cellpadding="0" cellspacing="0" border="0">
					<tr> 
						<td align="center" valign="bottom" style="width:180px;" nowrap="nowrap">
							<div style="text-align:center;">
								<img src="<?php echo JURI::base(true) ?>/components/com_ownservice/assets/images/logo.jpg" width="108" height="91"/>
							</div>
							<div>
								<span><strong>OWN Money Services</strong></span> <br />
							www.ownservices.com
							</div>
						</td>
						<td valign="top">
							<table width="100%" cellpadding="0" cellspacing="0">
								<tr>
									<td><span class="skey">Invoice Number:</span></td>
									<td><span style="font-size: 20px; font-weight: bold;"><?php echo $row->invoice; ?></span></td>
									<td><span class="skey">Date: <?php echo JHTML::_('date', $row->created, '%d/%m/%y'); ?></span></td>
									<td></td>
								</tr>
						  </table>
							<div class="bgcolor">
								<table width="100%" cellpadding="0" cellspacing="10">
									<tr>
										<td width="100px"><span class="skey">Branch:</span></td>
										<td ><span class="skey"><?php echo $row->branchname; ?></span></td>
									</tr>
									<tr>
										<td><span class="skey">Address:</span></td>
										<td><span class="skey"><?php echo $row->b_address.' '.$row->b_city.' '.$row->b_state.' '.$row->b_country.' '.$row->b_postcode; ?></span></td>
									</tr>
									<tr>
										<td><span class="skey">Phone No.:</span></td>
										<td><span class="skey"><?php echo $row->b_phone; ?></span></td>
									</tr>
									<tr>
										<td><span class="skey">E-mail:</span></td>
										<td><span class="skey"><?php echo $row->b_email; ?></span></td>
									</tr>
								</table>
							</div>
					  </td>
				  </tr>
				</table>
				<table width="100%" cellpadding="0" cellspacing="0">
					<tr>
						<td width="50%">
							<table width="100%" cellpadding="0" cellspacing="1">
								<tr>
									<td colspan="2"><strong>Sender Details</strong></td>
								</tr>
								<tr>
									<td><span class="skey">Name:</span> <?php echo $row->name; ?> (<?php echo $row->username; ?>)</td>
								</tr>
								<tr>
									<td colspan="2"><span class="skey">ID Type:</span> <?php echo ucwords($row->id_type); ?><div class="numprintright"><span class="skey">ID No.:</span> <?php echo 'xx'.substr($row->id_number,2); ?></div></td>
								</tr>
								<tr>
									<td colspan="2"><span class="skey">Expiry Date:</span> <?php echo JHTML::_('date', $row->expire_date, '%d/%m/%Y'); ?></td>
								</tr>
								<tr>
									<td colspan="2"><span class="skey">Issued by:</span> <?php echo $row->issuer; ?></td>
								</tr>
								<tr>
									<td colspan="2"><span class="skey">Address:</span> <?php echo $row->p_address.' '.$row->p_city.' '.$row->p_state.' '.$row->p_postcode.' '.$row->p_country; ?></td>
								</tr>
								<tr>
									<td colspan="2"><span class="skey">Phone No:</span> <?php echo $row->p_phone_no; ?></td>
								</tr>
							</table>
						</td>
						<td valign="top">
							<table width="100%" cellpadding="0" cellspacing="10">
								<tr>
									<td colspan="2"><strong>Transfer Details</strong></td>
								</tr>
								<tr>
									<td><span class="skey">Amount Transfer</span></td>
									<td align="right">(AUD) <?php echo OwnserviceHelper::moneyFormat($priceformat,$row->amount); ?></td>
								</tr>
								<tr>
									<td><span class="skey">Exchange Rate</span></td>
									<td align="right">(<?php echo $row->rate_code; ?>) <?php echo OwnserviceHelper::moneyFormat($priceformat,($row->rate+$row->extrarate)); ?></td>
								</tr>
								<tr>
									<td><span class="skey">Transfer Fee</span></td>
									<td align="right">(AUD) <?php echo OwnserviceHelper::moneyFormat($priceformat,($row->fee+$row->extrafee)); ?></td>
								</tr>
								<tr>
									<td><span class="skey">Overseas Bank Fee</span></td>
									<td align="right">(<?php echo $row->rate_code; ?>) <?php echo OwnserviceHelper::moneyFormat($priceformat,($row->bankfee+$row->extrabfee)); ?><br /><br /></td>
								</tr>
							</table>
						</td>
					</tr>
					<tr valign="top">
						<td style="padding-top:5px;">
							<table width="100%" cellpadding="0" cellspacing="1">
								<tr>
									<td colspan="2"><strong>Beneficiary and Bank Details</strong></td>
								</tr>
								<tr>
									<td colspan="2"><span class="skey">Name:</span> <?php echo $row->account_name; ?></td>
								</tr>
								<tr>
									<td width="60%"><span class="skey">Account No.:</span> <?php echo $row->account; ?></td>
									<td width="40%"><span class="skey">Type:</span> <?php echo ucwords($row->account_type); ?></td>
								</tr>
								<tr>
									<td><span class="skey">Bank:</span> 
									<?php if($row->bank_name=='other'): ?>
										<?php echo $row->bank_other; ?>
									<?php else: ?>
										<?php echo $row->bank_name; ?>
									<?php endif; ?>
									<br />
									<span class="skey">Bank City:</span> <?php echo $row->branch_city; ?></td>
									
								</tr>
								<tr>
									<td colspan="2"><span class="skey">Beneficiary's Address:</span> <?php echo $row->a_address.' '.$row->a_city.' '.$row->a_state.' '.$row->a_country.' '.$row->a_postcode; ?></td>
								</tr>
								<tr>
									<td colspan="2"><span class="skey">Phone No.:</span> <?php echo $row->a_phone_no; ?></td>
								</tr>
							</table>
						</td>
						<td valign="middle">
							<div style="border: 1px solid; padding: 5px 5px;">
								<table width="100%" cellpadding="0" cellspacing="9" border="0">
									<tr>
										<td><span class="skey">Total Receivable</span></td>
										<td align="right"><span class="skey">
											(<?php echo $row->rate_code; ?>) 
											<?php 
											/*$total = 0;
											if($row->extratotal > 0.00) {
												$total = $row->extratotal;
											} else {
												$total = $row->amount * ($row->rate+$row->extrarate);
											}*/
											if($row->extratotal > 0.00) {
												echo OwnserviceHelper::moneyFormat($priceformat, $row->extratotal);
											} else {
												echo OwnserviceHelper::moneyFormat($priceformat,( ($row->amount * ($row->rate+$row->extrarate)) - ($row->bankfee+$row->extrabfee)));
											}
											?></span>
										</td>
									</tr>
									<tr>
										<td><span class="skey">Total Payment</span></td>
										<td align="right">
											<span class="skey">(AUD)
											<?php 
											echo OwnserviceHelper::moneyFormat($priceformat,($row->amount + ($row->fee+$row->extrafee)));
											?>
											</span>
										</td>
									</tr>
								</table>
							</div>
							<p>Officer ID No.: <?php echo $row->cusername; ?></p>
						</td>
					</tr>
					<tr>
						<td><p><span class="skey">Purpose of Transfer:</span> <?php 
							if($row->reason != 'other') {
								echo OwnserviceHelper::getReason($row->reason); 
							} else {
								echo $row->reason_other;
							}
						?></p></td>
						<td>
							<p><table width="100%" border="0">
								<tr>
									<td nowrap="nowrap">Customer Signature</td>
									<td style="width:100%; border-bottom: 0.2em dotted;"></td>
								</tr>
							</table>
							</p>
						</td>
					</tr>
					<tr>
						<td align="center" colspan="2">
							<span class="footerprint">Please check and confirm beneficiary's bank details. Incorrect information may delay the process or transfer into the wrong accout. We will not take responsibility or claim back for you.<br />
By signing this form, I accept the terms and conditions set out by OWN Money Services, which strives to comply with Australian AML-CTF regulatory requirements.<br />
<strong>Please understand that the terms and conditions are subject to change without notice.</strong></span>
						</td>
					</tr>
				</table>
			</td>
		</tr>
	</table>
</div>
<script language="javascript" type="text/javascript">
<!--
window.print();
//-->
</script>
</body>
</html>